import 'package:acgn_pioneer/utils/_index.dart';

import 'base_model.dart';

class UserWithdrawItemModel {
  int cash;
  String cashRMB;
  int withdrawWay;
  int createdTime;
  int updatedTime;
  String destAccount;
  int status;

  UserWithdrawItemModel.fromJson(Map<String, dynamic> data) {
    cash = data['cash'];
    cashRMB = StringUtil.exchangeRMB(cash, 1);
    withdrawWay = data['withdraw_way'];
    createdTime = data['created_time'];
    updatedTime = data['updated_time'];
    destAccount = data['dest_account'];
    status = data['status'];
  }
}

class UserWithdrawModel extends BaseModel {
  PagerModel pager;
  List<UserWithdrawItemModel> data = [];
  UserWithdrawModel.fromJson(Map<String, dynamic> res) : super.fromJson(res) {
    pager = PagerModel.fromJson(res["pager"] ?? {});
    List list = res["data"] ?? [];
    list.forEach((item) {
      data.add(UserWithdrawItemModel.fromJson(item));
    });
  }
  @override
  Map<String, dynamic> toJson() {
    return {'pager': pager, 'data': data};
  }
}
